﻿<Page x:Class="SoftTeach.View.Personen.MetroSchülerlistePage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:personen="clr-namespace:SoftTeach.ViewModel.Personen"
      xmlns:setting="clr-namespace:SoftTeach.Setting"
      xmlns:personenView="clr-namespace:SoftTeach.View.Personen"
      mc:Ignorable="d" 
      d:DesignHeight="768" 
      d:DesignWidth="1366"
      Title="Schüler"
      FontSize="20">
  <Page.Resources>
    <ResourceDictionary>
      <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/SoftTeach;component/Resources/MetroResources.xaml"/>
        <ResourceDictionary >
          <DataTemplate DataType="{x:Type personen:PersonViewModel}" x:Key="PersonenDataTemplate">
            <personenView:MetroPersonDetailView />
          </DataTemplate>
        </ResourceDictionary>
      </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
  </Page.Resources>
  <Grid Stylus.IsPressAndHoldEnabled="False">
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto"/>
      <RowDefinition Height="*"/>
    </Grid.RowDefinitions>
    <Border Grid.Row="0" Background="{StaticResource MetroHeaderBackground}">
      <Label Foreground="White" HorizontalAlignment="Center">Person auswählen</Label>
    </Border>
    <ListBox Grid.Row="1"
                 ItemsSource="{Binding Source={x:Static setting:Selection.Instance}, Path=Schülerliste.SchülereinträgeView}"             
                 BorderThickness="0"
                 Name="PersonenListBox"
                 ItemTemplate="{StaticResource PersonenDataTemplate}"
                 ItemContainerStyle="{StaticResource MetroListBoxItem}">
      <ListBox.ItemsPanel>
        <ItemsPanelTemplate>
          <WrapPanel Width="{Binding ElementName=PersonenListBox, Path=ActualWidth, Converter={StaticResource WrapPanelWidthConverter}}" Orientation="Horizontal"/>
        </ItemsPanelTemplate>
      </ListBox.ItemsPanel>
    </ListBox>
  </Grid>
</Page>
